package com.woniuxy.micromallserver.ordermag.mapper;

import com.woniuxy.micromallserver.bean.AfterSaleServiceBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author unreleased
 * @date 2021/1/25 14:47
 * 售后服务mapper
 */
@Mapper
public interface AfterSaleServiceMapper {
    /**
     * 根据参数查找售后服务单
     *
     * @param afterSaleServiceBean 携带参数的对象
     * @return 售后单列表
     */
    List<AfterSaleServiceBean> findAfterSaleServiceListByParams(@Param("a") AfterSaleServiceBean afterSaleServiceBean);

    /**
     * 修改售后单状态
     *
     * @param id           订单订单id
     * @param handleStatus 处理状态
     * @return 是否修改成功
     */
    @Update("update after_sale_service set handle_status = #{handleStatus},handle_time=now() where id = #{id}")
    boolean updateStatus(@Param("id") Long id, @Param("handleStatus") String handleStatus);
}
